﻿using MediatR;
using T.Personnel.Domain;
using T.Personnel.Read.API.Application.Command.ManageCommand;
using T.Personnel.Repository.Interface;

namespace T.Personnel.Read.API.Application.CommandHandler.ManageHandler
{
    public class GetEntryManageHandler : IRequestHandler<GetEntryManageCommand, Manage>
    {
        private readonly IManageRepository manageRepository;

        public GetEntryManageHandler(IManageRepository manageRepository)
        {
            this.manageRepository = manageRepository;
        }

        public async Task<Manage> Handle(GetEntryManageCommand request, CancellationToken cancellationToken)
        {
            return await manageRepository.GetEntryAsync(request.id);
        }
    }
}
